<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>网页计算器</title>
</head>
<body>
<p>
    请输入整数一：<input type="text" id="one">
</p>
<p>
    请输入整数二：<input type="text" id="two">
</p>
<p>
    操作功能：
    <button onclick="ya(1)">相加</button>
    <button onclick="ya(2)">相减</button>
    <button onclick="ya(3)">相乘</button>
    <button onclick="ya(4)">相除</button>
</p>
<p>
    最终结果：<input type="text" id="new">
</p>
<script>
    function ya(w) {
        var one = document.querySelector("#one").value;
        one = Number(one);
        var two = document.querySelector("#two").value;
        two = Number(two);
        if(w==1){
            document.querySelector("#new").value = one + two;
        }
        if(w==2){
            document.querySelector("#new").value = one - two;
        }
        if(w==3){
            document.querySelector("#new").value = one * two;
        }
        if(w==4){
            document.querySelector("#new").value = one / two;
        }
    }
</script>
</body>
</html>